<?php 
		session_start(); 
		include "function/libfunc.php";
 			if (!empty($_SESSION['username']) && !empty($_SESSION['password'])) { 
		  	$link="Ongkos";
		  	include 'themes/head2.php';
			include 'themes/heading.php';
?>
          <!-- Build page from here: -->
                    
                    <div class="row-fluid">

                        <div class="span12">

                            <div class="box gradient">

                                <div class="title">
                                    <h4>
                                        <span><?php echo $link?> | <a href="tambahongkos.php">Tambah Ongkos</a></span>
                                    </h4>
                                </div>
                                <div class="content noPad clearfix">
                                    <table cellpadding="0" cellspacing="0" border="0" class="responsive dynamicTable display table table-bordered" width="100%">
                                        <thead>
                                            <tr>
                                                <th>ID</th>
                                                <th>Kabupaten</th>
                                                <th>Provinsi</th>
                                                <th>Biaya</th>
                                                <th>Biaya</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                           <?php
                                             $link = koneksi_db();
                                        $sql = "select * from ongkos ORDER BY provinsi ASC";
                                        $hasil = mysql_query($sql,$link) or exit("Error query: <b>".$sql."</b>.");
										while($data = mysql_fetch_assoc($hasil)){
										?>
                                            <tr>
                                         
                                                <td><?php echo $data['idongkos']; ?></td>
                                                <td><?php echo $data['kabupaten']; ?></td>
                                                <td><?php echo $data['provinsi']; ?></td>
                                                <td><?php echo $data['biaya']; ?></td>
                                                <td><div class="controls center">
                                                    <a href="ubahongkos.php?id=<?php echo $data['idongkos']; ?>" title="Edit task" class="tip2"><span class="icon12 icomoon-icon-pencil"></span></a>
                                                   <?php echo '<a href="#" id="'.$data['idongkos'].'" class="tip" title="Klik disini untuk menghapus data!"><span class="icon12 icomoon-icon-remove"></span></a>'; ?>
                                                </div></td>
                                            </tr>
                                            <?php
											}
										?>

                                        </tbody>
                                        <tfoot>
                                            <tr>
                                                <th>ID</th>
                                                <th>Kabupaten</th>
                                                <th>Provinsi</th>
                                                <th>Biaya</th>
                                            </tr>
                                        </tfoot>
                                    </table>
                                </div>
                                <script type="text/javascript">
$(function() {


$(".tip").click(function(){

//Save the link in a variable called element
var element = $(this);

//Find the id of the link that was clicked
var del_id = element.attr("id");

//Built a url to send
var info = 'id=' + del_id;
 if(confirm("Apakah anda yakin untuk menghapus data ini?"))
		  {
 $.ajax({
   type: "GET",
   url: "function/deleteongkos.php",
   data: info,
   success: function(){
   
   }
 });
         $(this).parents(".record").animate({ backgroundColor: "#fbc7c7" }, "fast")
		.animate({ opacity: "hide" }, "slow");

 }

return false;

});

});
</script>

                            </div><!-- End .box -->

                        </div><!-- End .span12 -->

                    </div><!-- End .row-fluid -->
					
					  <script type="text/javascript" src="themes/adminv1/js/datatable.js"></script><!-- Init plugins only for page -->
   <?php
include 'themes/footer.php';
}else {
echo "<script language='javascript'>window.location = '../admin/'</script>";
}
?>